package com.zhiqian.community.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "discusspost",shards = 6,replicas = 3)
public class DiscussPost implements Serializable {
    @Id
    private Integer id;

    @Field(type = FieldType.Integer)
    private Integer userId;

    @Field(type = FieldType.Text, analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String title;

    @Field(type = FieldType.Text ,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String content;

    @Field(type = FieldType.Integer)
    private Integer type=0;

    @Field(type = FieldType.Integer)
    private Integer status=0;

    @Field(type = FieldType.Date,format = DateFormat.date)
    private Date createTime;

    @Field(type = FieldType.Integer)
    private Integer commentCount=0;

    @Field(type = FieldType.Double)
    private Double score;

    @Field(type = FieldType.Integer)
    private Integer draft=0;
}
